package com.jimi.anno;

import com.jimi.validation.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;


@Documented
@Target(FIELD)
@Retention(RUNTIME)
@Constraint(validatedBy = {StateValidation.class})//指定提供校验规则的类
public @interface State {

    String message() default "state参数只能是已发布或草稿";

    Class<?>[] groups() default { };

    Class<? extends Payload>[] payload() default { };
}
